#define _CRT_SECURE_NO_WARNINGS

#include<iostream>
using namespace std;
#include"RBTree.hpp"

namespace myset
{
	template<class K>
	class set
	{
		struct KeyOfV
		{
			const K& operator()(const K& x)
			{
				return x;
			}
		};
	public:
		typedef typename RBTree<K, const K, KeyOfV>::Iterator  iterator;
		typedef typename RBTree<K, const K, KeyOfV>::ConstIterator const_iterator;


		iterator begin()
		{
			return tree.Begin();
		}
		iterator end()
		{
			return tree.End();
		}
		const_iterator begin()const
		{
			return tree.Begin();
		}
		const_iterator end()const
		{
			return tree.End();
		}
		pair<iterator, bool> insert(const K& key)
		{
			return tree.Insert(key);
		}
		bool empty()const
		{
			return tree.Empty();
		}
		size_t size()const
		{
			return tree.Size();
		}
		void swap(set& obj)
		{
			tree.Swap(obj.tree);
		}
		void clear()
		{
			tree.Clear();
		}
		iterator find(const K& key)
		{
			return tree.Find(key);
		}
		const_iterator find(const K& key) const
		{
			return tree.Find(key);
		}
	private:
		RBTree<K, const K, KeyOfV> tree;
	};
}